package c.francis.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import c.francis.pojo.Room;
import c.francis.service.impl.RoomServiceImpl;

@Controller
public class RoomController {
	@Autowired
	private RoomServiceImpl roomServiceImpl;
	
	@RequestMapping("querycheckroom")
	public @ResponseBody List<Room> querycheckroom(int cid,HttpServletRequest request) {
		try {
			List<Room> rooms = roomServiceImpl.queryCheckRoom(cid);
			request.setAttribute("rooms", rooms);
			return rooms;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
}
